package com.atguigu.gmall.common.constant;

import java.util.concurrent.TimeUnit;

public class RedisConst {
    public static final String SKU_DETAIL_CACHE_PREFIX = "sku:info:";
    public static final String TEMP_DATA = "x";

    public static final String LOCK_PREFIX = "lock-";

    //临时数据缓存ttl
    public static final long TEMP_DATA_TTL = 1L;
    public static final TimeUnit TEMP_DATA_TTL_UNIT = TimeUnit.HOURS;
    //skuid布隆过滤器
    public static final String BLOOM_SKUID = "skuid-bloom";
    public static final String CATEGORYS_CACHE = "categorys:all";

    //热度分
    public static final String HOTSCORE = "hotscore:";
    //用户登录
    public static final String USER_LOGIN = "user:login:";

    public static final String USER_ID_HEADER = "userid";

    public static final String USER_TEMP_ID_HEADER = "usertempid";
    public static final String CART_INFO = "cart:info:";
    public static final String SKU_PRICE = "sku:price:";

    //购物车中商品 品类最多200
    public static final Long CART_SIZE = 200L;
    //每个商品最多100
    public static final Integer CART_ITEM_LENGTH = 100;

    public static final long CART_TEMP_TTL = 365L; //以天为单位
    public static final String ORDER_TOKEN = "order:token:";
    //ms为单位
    public static final long ORDER_TTL = 30*60*1000L;
    public static final String MQ_RETRY = "mq:retrycount:"; //消息唯一id
    public static final String SECKILL_GOOD_KEY = "seckill:goods:";
    public static final String SECKILL_GOOD_CODE = "seckill:code:"; //秒杀码
    public static final String SECKILL_GOOD_STOCK = "seckill:good:stockcount:";
    public static final String SECKILL_ORDER = "seckill:order:";
    public static final String SECKILL_ORDER_NO_STOCK = "NO";
}
